<template>
	<div class="five">

			<!-- <my&#45;fourth :msg="message"></my&#45;fourth> -->
		<h1 class="oko"></h1>
	<h1 style="text-align:center ">登陆</h1>
	<transition name="bg">
	<h1 v-if="toggle"></h1>
	</transition>
	<x-input 
         :value="postDatas.merchantInfo.mobile"
         title="手机号"
	     is-type="china-mobile" 
          :show-clear=true 
          placeholder="请输入手机号"></x-input>
  <x-input 
         :value="postDatas.smsValidCode"
         title="验证码"
	     is-type="china-mobile" 
          :show-clear=true 
          placeholder="请输入验证码"></x-input>
	<!-- <button v&#45;on:click="toggle=!toggle">toggle</button> -->
	<x-button  @click.native="myclick" type="warn">登陆</x-button>
	<br>
	<br>
	<br>
	<br>
	<button @click="tryclick">3434</button>
	<!-- <tab :line&#45;width="2" active&#45;color="#fc378c"> -->
	<!--   <tab&#45;item :selected="demo2 === item" v&#45;for="item in list2" @click="demo2 = item">{{item}}</tab&#45;item> -->
	<!-- </tab> -->
	</div>
</template>


<script>
	import Fourth from './Fourth.vue'
import Vue from 'vue';
// console.debug(this.$store.state.register.url);
// console.debug(this.$store.state.register);
import { XButton, XInput, Tab, TabItem } from './index.js'
	export default {
		data () {
			return {
			name:"rebecca",
			message:'hellow lowwlow haha!',
			toggle: true	,
			postData: {
				},
			demo2: '美食',
		      list2: ['精选', '美食', '电影', '酒店', '外卖']
			}
		},
		computed: {
			myurl (){
				return this.$store.state.rests.register.url;
			},
			postDatas () {
				return this.$store.state.rests.register.param
			}
		},
		components:{
			'my-fourth':Fourth,
			XButton,
			XInput,
			Tab,
			TabItem
		},
		methods:{
			tryclick (){
	       	console.debug(this.myurl);
			},
			myclick	() {
				var xx = {mobile: 12123123}
let xixx = {
	"merchantInfo":{"mobile":"18815283024"},"smsValidCode":"99999"
}
this.$http.post(this.myurl ,this.postDatas).then(response => {
// this.$http.post('http://192.168.2.14:8080/merchants/register', this.phone).then(response => {
    // success callback
	var xx = document.getElementsByClassName('oko')
	xx[0].innerHTML= response
if(response.body.returnCode == 0)
	{
	this.$router.push('/bindCard')
	}
  }, response => {
    // error callback
	var xx = document.getElementsByClassName('oko')
	xx[0].innerHTML= `1212312  fail`

console.log(response +"fail")
  });

			}
		}
	}
</script>
<style type="text/css" >
.bg-leave {
	background: white;
}
.bg-enter{
	background:yellow;
}
.bg-enter-active{
	background: blue;
	transition:background-color 4s;
}
.bg-leave-active{
	background: red;
	transition:background-color 4s;
}
</style>
